function move(obj, target) {
  if (obj.timer) {
    clearInterval(obj.timer);
  }
  var speed = 10; // 一步的距离
  var length = obj.offsetLeft;
  //console.log(length);

  speed = length > target ? -speed : speed;
  //console.log(speed);
  obj.timer = setInterval(() => {
    if (Math.abs(length - target) > Math.abs(speed)) {
      length += speed;

      obj.style.left = length + "px";
    } else {
      obj.style.left = target + "px";
      clearInterval(obj.timer);
    }
  }, 20);
}
